package com.tlx.core.util;

import java.io.File;

import org.apache.commons.io.FilenameUtils;

public class RandomUtils {

    public static final String randomName(String tag, String srcPath) {

        String dir = new File(srcPath).getParent();
        String extName = FilenameUtils.getExtension(srcPath);
        String uuid = TlxUtils.getUuid();

        String newName = TlxUtils.PREFIX + "-" + tag + "-" + uuid + "." + extName;

        return new File(dir, newName).getAbsolutePath();
    }
}
